define(['jquery'],()=>{
    class Footer{
        constructor () {
            this.loadHtml().then(
                // console.log('也可以在这写')
            )
            
        }
        loadHtml () {
            return new Promise((resolve)=>{
                $('footer').load('/html/includes/footer.html',()=>{
                    resolve()
                    this.backTop()
                })
            })
            
        }

 /* 回到顶部 */
 backTop() {
    const divEle = document.querySelector('.backTop')
    divEle.addEventListener('click', function (e) {
      e = e || window.event //事件对象
      var scrollTop = document.documentElement.scrollTop
      var timer = setInterval(function () {
        document.documentElement.scrollTop = scrollTop - 50 //向上移动100px
        scrollTop = document.documentElement.scrollTop
        if (scrollTop <= 0) {
          clearInterval(timer)
        }
      }, 10)
    })
  }
    }
    return new Footer()
})


  
